<template>
  <div>
    <el-row>
      <el-col :span="24">
        <Sidebar :menuList="menuData"/>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Sidebar from "./SideBar.vue";
export default {
  components: { Sidebar },
  data() {
    return {
      menuData: [],
      defaultProps: {
        children: "children",
        label: "title"
      }
    };
  },
  computed: {
    defaultActive() {}
  },
  created() {
    this.init();
  },
  methods: {
    init() {
        // this.menuData = [{"funType":"2","modifyTime":"1557041113000","createTime":"1556245908000","children":[{"funType":"2","modifyTime":"1557041151000","createTime":"1556246998000","active":"1","description":"","location":"/channel","id":"51","funCode":"all","nodeType":"2","title":"渠道管理","parentId":"49"},{"funType":"2","modifyTime":"1557041495000","createTime":"1557041495000","active":"1","description":"","location":"/itemManage","id":"67","funCode":"1","nodeType":"2","title":"事项管理","parentId":"49"},{"funType":"2","modifyTime":"1557041552000","createTime":"1557041552000","active":"1","description":"","location":"/menuConfig","id":"68","funCode":"1","nodeType":"2","title":"菜单配置","parentId":"49"},{"funType":"2","modifyTime":"1557041588000","createTime":"1557041588000","active":"1","description":"","location":"/keyHome","id":"69","funCode":"1","nodeType":"2","title":"按键配置","parentId":"49"}],"active":"1","description":"","location":"12312","id":"49","funCode":"132123","nodeType":"1","title":"柜面管理端"},{"funType":"1","modifyTime":"1553859469000","createTime":"1553859453000","children":[{"funType":"1","modifyTime":"1553859471000","createTime":"1553859456000","active":"1","location":"/sys/function/queryTree","funOrder":"1","id":"2","funCode":"1122","nodeType":"2","title":"菜单管理","parentId":"1"},{"funType":"1","modifyTime":"1553859473000","createTime":"1553859459000","active":"1","location":"/sys/user/queryTable","funOrder":"1","id":"3","funCode":"1123","nodeType":"2","title":"用户管理","parentId":"1"},{"funType":"1","modifyTime":"1553859476000","createTime":"1553859461000","active":"1","location":"/sys/role/queryTable","funOrder":"2","id":"4","funCode":"1124","nodeType":"2","title":"角色管理","parentId":"1"},{"funType":"1","modifyTime":"1553859479000","createTime":"1553859463000","active":"1","location":"/sys/org/queryTree","funOrder":"3","id":"5","funCode":"1125","nodeType":"2","title":"机构管理","parentId":"1"},{"funType":"1","modifyTime":"1553859482000","createTime":"1553859465000","active":"1","location":"/sys/operateLog/queryTable","funOrder":"4","id":"6","funCode":"1126","nodeType":"2","title":"操作日志管理","parentId":"1"},{"funType":"1","modifyTime":"1556940402000","createTime":"1556940400000","active":"1","location":"/sys/code/queryTable","funOrder":"5","id":"7","funCode":"1127","nodeType":"2","title":"代码维护","parentId":"1"}],"icon":"","active":"1","funOrder":"0","id":"1","funCode":"1121","nodeType":"1","title":"权限管理","parentId":"0"}]      
      this.$get("/sys/function/queryFunctionList").then(data => {
        this.menuData=data.data.result;
      })
    },
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    } 
  }
};
</script>

<style scoped lang="css">
.iconfont {
  margin-right: 5px;
  width: 24px;
  text-align: center;
  font-size: 22px;
  vertical-align: middle;
  color: #909399;
}
</style>
